package com.smart.manage.service.impl;

import java.util.List;
import com.smart.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.manage.mapper.DoctorScheduleMapper;
import com.smart.manage.domain.DoctorSchedule;
import com.smart.manage.service.IDoctorScheduleService;

/**
 * 医生排班管理Service业务层处理
 * 
 * @author lingyao
 * @date 2025-01-30
 */
@Service
public class DoctorScheduleServiceImpl implements IDoctorScheduleService 
{
    @Autowired
    private DoctorScheduleMapper doctorScheduleMapper;

    /**
     * 查询医生排班管理
     * 
     * @param id 医生排班管理主键
     * @return 医生排班管理
     */
    @Override
    public DoctorSchedule selectDoctorScheduleById(Long id)
    {
        return doctorScheduleMapper.selectDoctorScheduleById(id);
    }

    /**
     * 查询医生排班管理列表
     * 
     * @param doctorSchedule 医生排班管理
     * @return 医生排班管理
     */
    @Override
    public List<DoctorSchedule> selectDoctorScheduleList(DoctorSchedule doctorSchedule)
    {
        return doctorScheduleMapper.selectDoctorScheduleList(doctorSchedule);
    }

    /**
     * 新增医生排班管理
     * 
     * @param doctorSchedule 医生排班管理
     * @return 结果
     */
    @Override
    public int insertDoctorSchedule(DoctorSchedule doctorSchedule)
    {
        doctorSchedule.setCreateTime(DateUtils.getNowDate());
        return doctorScheduleMapper.insertDoctorSchedule(doctorSchedule);
    }

    /**
     * 修改医生排班管理
     * 
     * @param doctorSchedule 医生排班管理
     * @return 结果
     */
    @Override
    public int updateDoctorSchedule(DoctorSchedule doctorSchedule)
    {
        doctorSchedule.setUpdateTime(DateUtils.getNowDate());
        return doctorScheduleMapper.updateDoctorSchedule(doctorSchedule);
    }

    /**
     * 批量删除医生排班管理
     * 
     * @param ids 需要删除的医生排班管理主键
     * @return 结果
     */
    @Override
    public int deleteDoctorScheduleByIds(Long[] ids)
    {
        return doctorScheduleMapper.deleteDoctorScheduleByIds(ids);
    }

    /**
     * 删除医生排班管理信息
     * 
     * @param id 医生排班管理主键
     * @return 结果
     */
    @Override
    public int deleteDoctorScheduleById(Long id)
    {
        return doctorScheduleMapper.deleteDoctorScheduleById(id);
    }
}
